<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<style>
body{padding: 0px;margin: 0px;}

#footer{width: auto;min-height: 60px;line-height:60px;text-

align:center;font-family:Arial, Helvetica, sans-serif}
#footer{border-top: thin solid #39A631;}#footer a{color:black;}
.con{width: 35%;height: 20em;margin-top:4em;min-width:260px;}
.con{border: thin solid #0080FF;}


 html,body{

               width: 100%;
               height: 100%

            } 
        body{
            background-color: #97CBFF;
            background-size: 100%;
           }


.con_title{background-color: #2894FF;width: auto;height: 3.5em;line-height: 

3.5em;text-align: center;min-width:260px;}
con_title_sp{font-family: "微软雅黑";font-size: 1.5em;font-weight: 

800;color: #FFF;}
.con_input{margin: 2em 0 1em 0;}

.submit-btn{width: 8em;height: 2em;background-color: #0080FF;border-radius: 

4px;border: 0px;color: #fff;font-family:"微软雅黑";font-size: 1em;font-

weight: bold;}
.con_input span{font-family: "微软雅黑";font-size: 1em;font-weight: 

bold;color: #333;}
.con_input input{width: 15em;padding: 0.5em 1em;border: 1px solid #bbb;}
.submit-btn{margin: 1em 0 1em 0;}
.con_select{margin-left: 2em;font-family:"微软雅黑";font-size: 1em;color: 

#333;}
</style>

<script>
    
function getPercent()
{
	   var amajor=$("#major").val();
	   var agrade=$("#grade").val();

			    $.ajax({
			    	 url: "/percent2",
					 data:{"smajor": amajor,"sgrade": agrade},
					 type:"post",
					 success: function(res)
					 {
						 $.each(res,function(i,fl){
	        	    		
							 var cid=fl.cno;
							 var name=fl.cname;
	                         var acount=fl.count1;
	                         var apercent=fl.percent1;
	                         var bcount=fl.count2;
	                         var bpercent=fl.percent2;
	                         var ccount=fl.count3;
	                         var cpercent=fl.percent3;
	                         var dcount=fl.count4;
	                         var dpercent=fl.percent4;
	                         var ecount=fl.count5;
	                         var epercent=fl.percent5;

	                         var value = "<tr><td align='center'>"+cid+"</td>";
	                          value +="<td align='center'>"+name+"</td><td align='center'>"+acount+"</td><td align='center'>"+apercent
	                          +"</td><td align='center'>"+bcount+"</td><td align='center'>"+bpercent+"</td><td align='center'>"+ccount+"</td><td align='center'>"+cpercent+"</td><td align='center'>"+dcount
	                          +"</td><td align='center'>"+dpercent+"</td><td align='center'>"+ecount+"</td><td align='center'>"+epercent+"</td><tr/>";
	                           
	                         
	                         $("#tb").append(value);
	  	                  });
					 }						
					 
})
			 }
</script>


<title>学生成绩百分比查询</title><base target="_blank" />
</head>
<body>
	
<div id="header">
<div class="header_title">
</div>

<div id="content">
<center>
<div class="con">
<div class="con_title">
<span class="con_title_sp">请输入专业和年级</span>
</div>
<div class="con_panel">
<div class="con_input">
<span>专 业：</span><input type="text" id="major" />
</div>
<div class="con_input">
<span>年 级：</span><input type="text" id="grade" />
</div>
<input type="submit" value="确认查看" class="submit-btn" onclick="getPercent()"/>
<input type="submit" value="返回" class="submit-btn" onclick="location.href='Administrator.html'"/>
</div>
</div>
</center>
</div>
<table id="tb" width="80%" border="1" cellspacing="0" cellpadding="0"
		align="center">
		<tr>
			<th align="center">课程号</th>
			<th align="center">课程名</th>
			<th align="center">60分以下人数</th>
			<th align="center">60分以下百分比</th>
			<th align="center">60~69分人数</th>
			<th align="center">60~69分百分比</th>
			<th align="center">70~79分人数</th>
			<th align="center">70~79分百分比</th>
			<th align="center">80~89分人数</th>
			<th align="center">80~89分百分比</th>
			<th align="center">90~100分人数</th>
			<th align="center">90~100分百分比</th>

		</tr>
	</table>
</body>
</html>